import {defineComponent, onUnmounted, reactive, toRefs} from 'vue'
import Draw from './draw'

export default defineComponent({
  props: {
    pie: {
      type: Object,// 引用类型的话,默认值要为函数返回值的形式!!! 1.String 2.Number 3.Boolean 4.Array 5.Object 6.Date 7.Function 8.Symbol
      require: true
    },
  },
  components: {
    Draw,
  },
  setup(props) {
    const { pie } = toRefs(props)
    const  width = pie.value.width
    const  height = pie.value.height
    const  xData = pie.value.xData
    const  seriesColor = pie.value.seriesColor
    const  seriesData = pie.value.seriesData
    const cdata ={xData,seriesColor, seriesData}
    return () => {
      return (
        <div>
          <Draw cdata={cdata} width={width} height={height} />
        </div>
      )
    }
  },
})
